package com.wf.smartcomm.server.bean;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.google.gson.annotations.Expose;

/** 
 * @author 38884306@qq.com  
 * @version 创建时间：2015-5-25 上午9:57:16 
 * 
 */
@Entity
@Table(name = "t_ad")
public class Advertisement {
	@Expose
	@Id
	@Column(length = 32)
	private String objectId;
	
	@ManyToOne
	@JoinColumn(name = "uid")
	private User user;
	
	@ManyToOne
	@JoinColumn(name = "vid")
	private Village village;
	
	@Expose
	@Column(length = 32)
	private String subject;
	
	@Type(type="text")
	@Column
	private String content;
	
	@Expose
	@Column(length = 10)
	private int counts;
	
	@Expose
	@Column(length = 20)
	private String beginAt;
	
	@Expose
	@Column(length = 20)
	private String endAt;
	
	@Column(length = 20)
	private String createdAt;
	
	@Expose
	@Column(length = 20)
	private String updateAt;
	
	@Expose
	@Column(length = 1024)
	private String imageUrl;
	
	@Expose
	@OneToMany(fetch=FetchType.EAGER,mappedBy="ad")
	private Set<ThumbImage> thumbImages;
	
	public String getObjectId() {
		return objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public int getCounts() {
		return counts;
	}

	public void setCounts(int counts) {
		this.counts = counts;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Village getVillage() {
		return village;
	}

	public void setVillage(Village village) {
		this.village = village;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(String createdAt) {
		this.createdAt = createdAt;
	}

	public String getUpdateAt() {
		return updateAt;
	}

	public void setUpdateAt(String updateAt) {
		this.updateAt = updateAt;
	}

	public String getBeginAt() {
		return beginAt;
	}

	public void setBeginAt(String beginAt) {
		this.beginAt = beginAt;
	}

	public String getEndAt() {
		return endAt;
	}

	public void setEndAt(String endAt) {
		this.endAt = endAt;
	}

	public String getImageUrl() {
		return imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}
}
